<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://jee.io/tags/navigation/pager" prefix="pg"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<pg:pager maxPageItems="${pager.pageItems}" url="${param.url}" items="${pager.total}" export="currentPageNumber=pageNumber">
	<%
    	java.util.Enumeration<String> parameter =  request.getParameterNames();
    	while(parameter.hasMoreElements()){
    		String name = parameter.nextElement();
    		if(!name.equals("url")&&!name.equals("offset")){
	    		%>
	    		<pg:param name="<%=name %>" value="<%=request.getParameter(name) %>"/>
	    		<%
    		}
    	}
    %>
	<div class="panel-foot text-center">
		<pg:first>
			<ul class="pagination"><li><a href="${pageUrl}">首页</a></li></ul>
		</pg:first>
		<pg:prev>
        	<ul class="pagination"><li><a href="${pageUrl}">上一页</a></li></ul>
        </pg:prev>
        <pg:pages>
        	<ul class="pagination pagination-group">
	        <c:choose>  
	            <c:when test="${currentPageNumber == pageNumber }">  
	            <li class="active"><a href="#">${pageNumber}</a></li>  
	            </c:when>  
	            <c:otherwise>
	            	<li><a href="${pageUrl}">${pageNumber}</a></li>
	            </c:otherwise>  
	        </c:choose>
	        </ul>
    	</pg:pages>  
        <pg:next>
        	<ul class="pagination"><li><a href="${pageUrl}">下一页</a></li></ul>
        </pg:next>
        <pg:last>  
        	<ul class="pagination"><li><a href="${pageUrl}">尾页</a></li></ul> 
    	</pg:last>
    </div>
</pg:pager>